package com.xiaokaceng.openci.dto;

import java.util.HashSet;
import java.util.Set;

import com.xiaokaceng.openci.domain.ToolInterfaceImplement;

public class ToolInterfaceImplementDto extends BaseDto {

	private static final long serialVersionUID = 4039635368369364257L;

	private String toolInterface;

	private boolean isSuccess;

	private String executeDate;

	private String record;

	public static Set<ToolInterfaceImplementDto> transformBy(Set<ToolInterfaceImplement> toolInterfaceImplements) {
		Set<ToolInterfaceImplementDto> toolInterfaceImplementDtos = new HashSet<ToolInterfaceImplementDto>();
		for (ToolInterfaceImplement each : toolInterfaceImplements) {
			ToolInterfaceImplementDto toolInterfaceImplementDto = new ToolInterfaceImplementDto();
			toolInterfaceImplementDto.setToolInterface(each.getToolInterface().toString());
			toolInterfaceImplementDto.setSuccess(each.isSuccess());
			toolInterfaceImplementDto.setExecuteDate(dateToString(each.getExecuteDate()));
			toolInterfaceImplementDto.setRecord(each.getRecord());
			toolInterfaceImplementDtos.add(toolInterfaceImplementDto);
		}
		return toolInterfaceImplementDtos;
	}
	
	public String getToolInterface() {
		return toolInterface;
	}

	public void setToolInterface(String toolInterface) {
		this.toolInterface = toolInterface;
	}

	public boolean isSuccess() {
		return isSuccess;
	}

	public void setSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}

	public String getExecuteDate() {
		return executeDate;
	}

	public void setExecuteDate(String executeDate) {
		this.executeDate = executeDate;
	}

	public String getRecord() {
		return record;
	}

	public void setRecord(String record) {
		this.record = record;
	}

}
